import Router from 'koa-router';
import proxyService from '../../../common/proxyService';
import {
  getActivityInfoBargain,
  updateWriteOffBargain,
  getCorpWriteOff,
  getCorpWriteOffList,
} from '../../../api';

const router = new Router();
router.get('/getActivityInfoBargain', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getActivityInfoBargain);
  return (ctx.body = response);
});
router.get('/updateWriteOffBargain', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, updateWriteOffBargain);
  return (ctx.body = response);
});
router.get('/getCorpWriteOff', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getCorpWriteOff);
  return (ctx.body = response);
});
router.get('/getCorpWriteOffList', async ctx => {
  console.log(ctx.request.query);
  const response = await proxyService.postProxy(ctx, getCorpWriteOffList);
  return (ctx.body = response);
});

export default router;
